"use strict";
cc._RF.push(module, 'eb3e7Tv/olBgK1jrGvEl7Cv', 'give_up_view');
// scripts/give_up_view.js

"use strict";

var e = require;
var t = module;
var o = exports;

var _ii,
    nn = void 0 && (void 0).__extends || (_ii = function ii(t, e) {
  return (_ii = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (t, e) {
    t.__proto__ = e;
  } || function (t, e) {
    for (var o in e) {
      Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
    }
  })(t, e);
}, function (t, e) {
  function o() {
    this.constructor = t;
  }

  _ii(t, e), t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o());
}),
    rr = void 0 && (void 0).__awaiter || function (t, e, o, i) {
  return new (o || (o = Promise))(function (n, a) {
    function r(t) {
      try {
        l(i.next(t));
      } catch (e) {
        a(e);
      }
    }

    function s(t) {
      try {
        l(i["throw"](t));
      } catch (e) {
        a(e);
      }
    }

    function l(t) {
      var e;
      t.done ? n(t.value) : (e = t.value, e instanceof o ? e : new o(function (t) {
        t(e);
      })).then(r, s);
    }

    l((i = i.apply(t, e || [])).next());
  });
};

var oo = void 0 && (void 0).__decorate || function (e, t, a, n) {
  var i,
      o = arguments.length,
      s = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, a) : n;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, a, n);else for (var r = e.length - 1; r >= 0; r--) {
    (i = e[r]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, a, s) : i(t, a)) || s);
  }
  return o > 3 && s && Object.defineProperty(t, a, s), s;
};

Object.defineProperty(o, "__esModule", {
  value: !0
});

var a = e("BaseModuleUI"),
    n = e("NotifyEventType"),
    i = e("GlobalParams"),
    r = e("CommonHelper"),
    s = cc._decorator,
    l = s.ccclass,
    _ = s.property,
    c = function (e) {
  function t() {
    var t = null !== e && e.apply(this, arguments) || this;
    return t.give_up_view = [], t;
  }

  return nn(t, e), t.prototype.initView = function () {
    for (var e = this, t = 0; t < 5; t++) {
      this.give_up_view[t].children[0].active = 0 == t, this.give_up_view[t].children[1].active = !1;
    }

    this.scheduleOnce(function () {
      e.showAiChoose(1);
    }, r["default"].getRandomInt(20, 40) / 10);
  }, t.prototype.showAiChoose = function (e) {
    var t = this,
        o = r["default"].getRandomInt(1, 100) < 50;
    this.give_up_view[e].children[0].active = o, this.give_up_view[e].children[1].active = !o, o ? this.scheduleOnce(function () {
      i.GlobalParams.GameStart = !1, i.GlobalParams.GamePlayerWin = !1, t.emitEvent(n["default"].SEND_GAME_OVER_INFO), t.node.active = !1;
    }, 2) : 3 == e ? this.scheduleOnce(function () {
      i.GlobalParams.GameGiveUpTime = new Date().getTime() + 6e4, t.node.active = !1;
    }, 3) : this.scheduleOnce(function () {
      t.showAiChoose(2);
    }, r["default"].getRandomInt(20, 40) / 10);
  }, oo([_(cc.Node)], t.prototype, "give_up_view", void 0), oo([l], t);
}(a["default"]);

o["default"] = c;

cc._RF.pop();